package com.hy.mydesktop.shared.rpc.util;

import com.hy.mydesktop.client.component.meta.GxtComponentMetaModel;
import com.hy.mydesktop.client.component.meta.GxtComponentMetaNodeModel;
import com.hy.mydesktop.client.component.type.ComponentControllerEnum;

public class MvcAppEventsConverter {
	public static GxtComponentMetaModel updateComponentControllerEnum(GxtComponentMetaModel gxtComponentMetaModel) {
		for (GxtComponentMetaNodeModel gxtComponentMetaNodeModel : gxtComponentMetaModel.getList()) {
			updateComponentControllerEnum(gxtComponentMetaNodeModel);
		}
		return gxtComponentMetaModel;
	}
	/**
	 * 
	 * <ul>
	 * <li>方法含义：根据componentControllerEnumIndex，设置GxtComponentMetaNodeModel的ComponentControllerEnum</li>
	 * <li>方法作者：花宏宇</li>
	 * <li>编写日期：2010-10-26；时间：下午上午10:21:36</li>
	 * </ul>
	 * <ul>
	 * <b>修订编号：</b>
	 * <li>修订日期：</li>
	 * <li>修订作者：</li>
	 * <li>修订原因：</li>
	 * <li>修订内容：</li>
	 * </ul>
	 * @param gxtComponentMetaNodeModel
	 * @return
	 */
	public static GxtComponentMetaNodeModel updateComponentControllerEnum(GxtComponentMetaNodeModel gxtComponentMetaNodeModel) {
		gxtComponentMetaNodeModel.setComponentControllerEnum(getComponentControllerEnum(gxtComponentMetaNodeModel.getComponentControllerEnumIndex()));
		return gxtComponentMetaNodeModel;
	}

	
	public static ComponentControllerEnum getComponentControllerEnum(int componentControllerEnumIndex) {
		GxtComponentMetaNodeModel gxtComponentMetaNodeModel = new GxtComponentMetaNodeModel();
		
		switch (componentControllerEnumIndex) {
			case 0://ComponentControllerEnum.TREEPANELMODULES_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TREEPANELMODULES_CONTROLLER_MODEL);
				break;

			case 1://ComponentControllerEnum.GRIDSETMODULES_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.GRIDSETMODULES_CONTROLLER_MODEL);				
				break;

			case 2://ComponentControllerEnum.GRID_MODULE_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.GRID_MODULE_CONTROLLER_MODEL);				
				break;

			case 3://ComponentControllerEnum.TREE_DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TREE_DATALOAD_CONTROLLER_MODEL);				
				break;
							
			case 4://ComponentControllerEnum.GRID_DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.GRID_DATALOAD_CONTROLLER_MODEL);								
				break;				
			case 5://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL);								
				break;
				
			case 6://ComponentControllerEnum.GRID_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.GRID_CONTROLLER_MODEL);								
				break;
			case 7://ComponentControllerEnum.DATEFIELD_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DATEFIELD_CONTROLLER_MODEL);								
				break;
				
			case 8://ComponentControllerEnum.COMBOBOX_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.COMBOBOX_CONTROLLER_MODEL);								
				break;
				
			//case XXX6:
			//	gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL);								
			//	break;
				
			case 9://ComponentControllerEnum.FORMSET_MODULE_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.FORMSET_MODULE_CONTROLLER_MODEL);
				break;
				
			case 10://ComponentControllerEnum.FORMMODULE_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.FORMMODULE_CONTROLLER_MODEL);
				break;
				
			case 11://ComponentControllerEnum.DESKTOP_STARTMENU_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DESKTOP_STARTMENU_CONTROLLER_MODEL);
				break;
				
			
				
			case 12://ComponentControllerEnum.TEXTFIELD_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TEXTFIELD_CONTROLLER_MODEL);
				break;

			case 13://ComponentControllerEnum.FORMPANEL_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.FORMPANEL_CONTROLLER_MODEL);
				break;
				
			case 14://ComponentControllerEnum.TOOLBAR_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.TOOLBAR_CONTROLLER_MODEL);
				break;
				
			case 15://ComponentControllerEnum.MENUBAR_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.MENUBAR_CONTROLLER_MODEL);
				break;
				
			case 16://ComponentControllerEnum.DESKTOP_MENUITEM_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DESKTOP_MENUITEM_CONTROLLER_MODEL);
				break;
			case 17://ComponentControllerEnum.CONTENTPANEL_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.CONTENTPANEL_CONTROLLER_MODEL);
				break;
				
			case 18://ComponentControllerEnum.WINDOW_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.WINDOW_CONTROLLER_MODEL);
				break;
			case 19://ComponentControllerEnum.DESKTOP_CONTROL_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.DESKTOP_CONTROLLOR_MODEL);
				break;
				
			case 20://ComponentControllerEnum.DATALOAD_CONTROLLER_MODEL.ordinal():
				gxtComponentMetaNodeModel.setComponentControllerEnum(ComponentControllerEnum.SHORTCUT_CONTROLLER_MODEL);
				break;
			
			default:
				assert false : "Error converting componentControllerEnumIndex to ComponentControllerEnum : componentControllerEnumIndex = "+componentControllerEnumIndex;
				break;
		}
		return gxtComponentMetaNodeModel.getComponentControllerEnum();
		/**
		 * 树形面板组件控制器
		 */
		
		
		/**
		 * 表格组件集合控制器
		 */
		

		
		/**
		 * 表格组件控制器
		 */
		//,
		
		/**
		 *树中数据加载的控制器 
		 */
		
		/**
		 *表格中数据加载的控制器 
		 */
		
		
		/**
		 *数据加载的控制器 
		 */
		
		
		/**
		 * 表格控制器
		 */
		

		
		/**
		 * 日期域控制器
		 */
		
		/**
		 * 复选框域控制器
		 */
		
		
		
		/**
		 * 表单集合组件控制器
		 */
		
		/**
		 * 表单组件控制器
		 */
		
		/**
		 * desktop开始菜单控制器
		 */
		
		/**
		 * 文本域控制器
		 */
		
		/**
		 * 表单面板控制器
		 */
		
		/**
		 * 工具栏控制器
		 */
		/**
		 * 菜单栏控制器
		 */
		/**
		 * 桌面开始菜单项MenuItem控制器
		 */
		/**
		 * 内容面板控制器
		 */
		/**
		 * 窗口控制器
		 */
		/**
		 * Desktop桌面
		 */
		/**
		 * 快捷方式
		 */
	}
}
